<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="button" value="打开新窗口" disabled>
</body>
<script>
    window.onload = function () {
        //windows.open('链接',名字,参数、设置)
        /*
          参数：
            width  height
            left right top:新窗口到某端的距离
            scrollbar 滚动条
            toolbar 工具栏 yes no 1 0
            loaction 地址栏 浏览器默认TRUE
         */
        window.open("http://www.baidu.com","百度",
            "width=600,height=400,top=100,left=100,right=100,scollbars=auto,toolbar=yes");
        let time = setTimeout(function () {
            window.close();
            //清除一次性定时器 先给定时器一个名字 匿名定时器无法清除
            //window.clearTimeout(time);反复性：window.clearInterval(time)
        },10000);
    }
</script>
</html>